//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS OpsWorksCM service.
///
/// OpsWorks CM  The OpsWorks services have reached end of life and have been disabled for both new and existing customers.  We strongly recommend customers migrate their workloads to other solutions as soon as possible. If you have questions about migration, reach out to the Amazon Web ServicesSupport Team on Amazon Web Services re:Post or through Amazon Web Services Premium Support.  OpsWorks CM is a service that runs and manages configuration management servers. You can use OpsWorks CM to create and manage OpsWorks for Chef Automate and  OpsWorks for Puppet Enterprise servers, and add or remove nodes for the servers to manage.  Glossary of terms     Server: A configuration management server that can be  highly-available. The configuration management server runs on an Amazon Elastic Compute Cloud (EC2) instance, and may use various other Amazon Web Services services, such as Amazon Relational Database Service  (RDS) and Elastic Load Balancing. A server is a generic abstraction over the configuration manager that you want to use, much like Amazon RDS. In OpsWorks CM, you do not start or stop servers. After you create servers, they continue to run until they are deleted.    Engine: The engine is the specific configuration manager  that you want to use. Valid values in this release include ChefAutomate and Puppet.    Backup: This is an application-level backup of the data that the configuration manager stores. OpsWorks CM creates an S3 bucket for backups when you launch the first server. A backup maintains a snapshot of a server's configuration-related attributes at the time the backup starts.    Events: Events are always related to a server. Events are written during server creation, when health checks run, when backups are created, when system maintenance is performed, etc. When you delete a server, the server's events are also deleted.    Account attributes: Every account has attributes that are assigned in the OpsWorks CM database. These attributes store information about configuration limits (servers, backups, etc.) and your customer account.     Endpoints  OpsWorks CM supports the following endpoints, all HTTPS. You must connect to one of the following endpoints.  Your servers can only be accessed or managed within the endpoint in which they are created.   opsworks-cm.us-east-1.amazonaws.com   opsworks-cm.us-east-2.amazonaws.com   opsworks-cm.us-west-1.amazonaws.com   opsworks-cm.us-west-2.amazonaws.com   opsworks-cm.ap-northeast-1.amazonaws.com   opsworks-cm.ap-southeast-1.amazonaws.com   opsworks-cm.ap-southeast-2.amazonaws.com   opsworks-cm.eu-central-1.amazonaws.com   opsworks-cm.eu-west-1.amazonaws.com   For more information, see OpsWorks endpoints and quotas in the Amazon Web Services General Reference.  Throttling limits  All API operations allow for five requests per second with a burst of 10 requests per second.
public struct OpsWorksCM: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the OpsWorksCM client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            amzTarget: "OpsWorksCM_V2016_11_01",
            serviceName: "OpsWorksCM",
            serviceIdentifier: "opsworks-cm",
            serviceProtocol: .json(version: "1.1"),
            apiVersion: "2016-11-01",
            endpoint: endpoint,
            errorType: OpsWorksCMErrorType.self,
            xmlNamespace: "http://opsworks-cm.amazonaws.com/doc/2016-11-01/",
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    ///  Associates a new node with the server. For more information about how to disassociate a node, see DisassociateNode.  On a Chef server: This command is an alternative to  knife bootstrap.  Example (Chef): aws opsworks-cm associate-node --server-name MyServer --node-name MyManagedNode --engine-attributes "Name=CHEF_ORGANIZATION,Value=default" "Name=CHEF_AUTOMATE_NODE_PUBLIC_KEY,Value=public-key-pem"   On a Puppet server, this command is an alternative to the puppet cert sign command that signs a Puppet node CSR.   Example (Puppet): aws opsworks-cm associate-node --server-name MyServer --node-name MyManagedNode --engine-attributes "Name=PUPPET_NODE_CSR,Value=csr-pem"   A node can can only be associated with servers that are in a HEALTHY state. Otherwise, an InvalidStateException is thrown. A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is raised when parameters of the request are not valid. The AssociateNode API call can be integrated into Auto Scaling configurations, CloudFormation templates, or the user data  of a server's instance.
    @Sendable
    @inlinable
    public func associateNode(_ input: AssociateNodeRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> AssociateNodeResponse {
        try await self.client.execute(
            operation: "AssociateNode", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Associates a new node with the server. For more information about how to disassociate a node, see DisassociateNode.  On a Chef server: This command is an alternative to  knife bootstrap.  Example (Chef): aws opsworks-cm associate-node --server-name MyServer --node-name MyManagedNode --engine-attributes "Name=CHEF_ORGANIZATION,Value=default" "Name=CHEF_AUTOMATE_NODE_PUBLIC_KEY,Value=public-key-pem"   On a Puppet server, this command is an alternative to the puppet cert sign command that signs a Puppet node CSR.   Example (Puppet): aws opsworks-cm associate-node --server-name MyServer --node-name MyManagedNode --engine-attributes "Name=PUPPET_NODE_CSR,Value=csr-pem"   A node can can only be associated with servers that are in a HEALTHY state. Otherwise, an InvalidStateException is thrown. A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is raised when parameters of the request are not valid. The AssociateNode API call can be integrated into Auto Scaling configurations, CloudFormation templates, or the user data  of a server's instance.
    ///
    /// Parameters:
    ///   - engineAttributes: Engine attributes used for associating the node.   Attributes accepted in a AssociateNode request for Chef     CHEF_ORGANIZATION: The Chef organization with which the node is associated. By default only one organization named default can exist.     CHEF_AUTOMATE_NODE_PUBLIC_KEY: A PEM-formatted public key. This key is required for the chef-client agent to access the Chef API.     Attributes accepted in a AssociateNode request for Puppet     PUPPET_NODE_CSR: A PEM-formatted certificate-signing request (CSR) that is created by the node.
    ///   - nodeName: The name of the node.
    ///   - serverName: The name of the server with which to associate the node.
    ///   - logger: Logger use during operation
    @inlinable
    public func associateNode(
        engineAttributes: [EngineAttribute],
        nodeName: String,
        serverName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> AssociateNodeResponse {
        let input = AssociateNodeRequest(
            engineAttributes: engineAttributes, 
            nodeName: nodeName, 
            serverName: serverName
        )
        return try await self.associateNode(input, logger: logger)
    }

    ///  Creates an application-level backup of a server. While the server is in the BACKING_UP state, the server cannot be changed, and no additional backup can be created.   Backups can be created for servers in RUNNING, HEALTHY, and UNHEALTHY states.  By default, you can create a maximum of 50 manual backups.   This operation is asynchronous.   A LimitExceededException is thrown when the maximum number of manual backups is reached. An InvalidStateException is thrown when the server is not in any of the following states: RUNNING, HEALTHY, or UNHEALTHY. A ResourceNotFoundException is thrown when the server is not found. A ValidationException is thrown when parameters of the request are not valid.
    @Sendable
    @inlinable
    public func createBackup(_ input: CreateBackupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateBackupResponse {
        try await self.client.execute(
            operation: "CreateBackup", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Creates an application-level backup of a server. While the server is in the BACKING_UP state, the server cannot be changed, and no additional backup can be created.   Backups can be created for servers in RUNNING, HEALTHY, and UNHEALTHY states.  By default, you can create a maximum of 50 manual backups.   This operation is asynchronous.   A LimitExceededException is thrown when the maximum number of manual backups is reached. An InvalidStateException is thrown when the server is not in any of the following states: RUNNING, HEALTHY, or UNHEALTHY. A ResourceNotFoundException is thrown when the server is not found. A ValidationException is thrown when parameters of the request are not valid.
    ///
    /// Parameters:
    ///   - description:  A user-defined description of the backup.
    ///   - serverName: The name of the server that you want to back up.
    ///   - tags: A map that contains tag keys and tag values to attach to an OpsWorks CM server backup.   The key cannot be empty.   The key can be a maximum of 127 characters, and can contain only Unicode letters, numbers, or separators, or the  following special characters: + - = . _ : /    The value can be a maximum 255 characters, and contain only Unicode letters, numbers, or separators, or the  following special characters: + - = . _ : /    Leading and trailing white spaces are trimmed from both the key and value.   A maximum of 50 user-applied tags is allowed for tag-supported OpsWorks CM resources.
    ///   - logger: Logger use during operation
    @inlinable
    public func createBackup(
        description: String? = nil,
        serverName: String,
        tags: [Tag]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateBackupResponse {
        let input = CreateBackupRequest(
            description: description, 
            serverName: serverName, 
            tags: tags
        )
        return try await self.createBackup(input, logger: logger)
    }

    ///  Creates and immedately starts a new server. The server is ready to use when it is in the HEALTHY state. By  default, you can create a maximum of 10 servers.   This operation is asynchronous.   A LimitExceededException is thrown when you have created the maximum number of servers (10). A  ResourceAlreadyExistsException is thrown when a server with the same name already exists in the account. A ResourceNotFoundException is thrown when  you specify a backup ID that is not valid or is for a backup that does not exist. A ValidationException is thrown when  parameters of the request are not valid.   If you do not specify a security group by adding the SecurityGroupIds parameter, OpsWorks creates a new  security group.   Chef Automate: The default security group opens the Chef server to the world on TCP port 443. If  a KeyName is present, OpsWorks enables SSH access. SSH is also open to the world on TCP port 22.   Puppet Enterprise: The default security group opens TCP ports 22, 443, 4433, 8140, 8142, 8143, and 8170. If a KeyName is present, OpsWorks enables SSH access. SSH is also open to the world on TCP port 22.  By default, your server is accessible from any IP address. We recommend that you update your security group rules to allow access from known IP addresses and address ranges only. To edit security group rules, open Security Groups in the navigation pane of the EC2 management console.  To specify your own domain for a server, and provide your own self-signed or CA-signed certificate and private key,  specify values for CustomDomain,  CustomCertificate, and CustomPrivateKey.
    @Sendable
    @inlinable
    public func createServer(_ input: CreateServerRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateServerResponse {
        try await self.client.execute(
            operation: "CreateServer", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Creates and immedately starts a new server. The server is ready to use when it is in the HEALTHY state. By  default, you can create a maximum of 10 servers.   This operation is asynchronous.   A LimitExceededException is thrown when you have created the maximum number of servers (10). A  ResourceAlreadyExistsException is thrown when a server with the same name already exists in the account. A ResourceNotFoundException is thrown when  you specify a backup ID that is not valid or is for a backup that does not exist. A ValidationException is thrown when  parameters of the request are not valid.   If you do not specify a security group by adding the SecurityGroupIds parameter, OpsWorks creates a new  security group.   Chef Automate: The default security group opens the Chef server to the world on TCP port 443. If  a KeyName is present, OpsWorks enables SSH access. SSH is also open to the world on TCP port 22.   Puppet Enterprise: The default security group opens TCP ports 22, 443, 4433, 8140, 8142, 8143, and 8170. If a KeyName is present, OpsWorks enables SSH access. SSH is also open to the world on TCP port 22.  By default, your server is accessible from any IP address. We recommend that you update your security group rules to allow access from known IP addresses and address ranges only. To edit security group rules, open Security Groups in the navigation pane of the EC2 management console.  To specify your own domain for a server, and provide your own self-signed or CA-signed certificate and private key,  specify values for CustomDomain,  CustomCertificate, and CustomPrivateKey.
    ///
    /// Parameters:
    ///   - associatePublicIpAddress:  Associate a public IP address with a server that you are launching. Valid values are true or false. The default value is true.
    ///   - backupId:  If you specify this field, OpsWorks CM creates the server by using the backup represented by BackupId.
    ///   - backupRetentionCount:  The number of automated backups that you want to keep. Whenever a new backup is created, OpsWorks CM deletes the oldest backups if this number is exceeded. The default value is 1.
    ///   - customCertificate: A PEM-formatted HTTPS certificate. The value can be be a single, self-signed certificate, or a certificate chain. If you specify a  custom certificate, you must also specify values for CustomDomain and CustomPrivateKey. The following are requirements for the CustomCertificate value:   You can provide either a self-signed, custom certificate, or the full certificate chain.   The certificate must be a valid X509 certificate, or a certificate chain in PEM format.   The certificate must be valid at the time of upload. A certificate can't be used before its validity period begins (the certificate's NotBefore date), or after it expires  (the certificate's NotAfter date).   The certificate’s common name or subject alternative names (SANs), if present, must match the value of CustomDomain.   The certificate must match the value of CustomPrivateKey.
    ///   - customDomain: An optional public endpoint of a server, such as https://aws.my-company.com. To access the server, create a CNAME DNS record in your preferred DNS service that points the custom  domain to the endpoint that is generated when the server is created (the value of the CreateServer Endpoint attribute). You cannot access the server by using the  generated Endpoint value if the server is using a custom domain. If you specify a custom domain, you must also specify values for CustomCertificate  and CustomPrivateKey.
    ///   - customPrivateKey: A private key in PEM format for connecting to the server by using HTTPS. The private key must not be encrypted; it cannot be protected by a password or passphrase.  If you specify a custom private key, you must also specify values for CustomDomain and CustomCertificate.
    ///   - disableAutomatedBackup:  Enable or disable scheduled backups. Valid values are true or false. The default value is true.
    ///   - engine:  The configuration management engine to use. Valid values include ChefAutomate and Puppet.
    ///   - engineAttributes: Optional engine attributes on a specified server.   Attributes accepted in a Chef createServer request:     CHEF_AUTOMATE_PIVOTAL_KEY: A base64-encoded RSA public key. The corresponding private key is required to access the Chef API. When no CHEF_AUTOMATE_PIVOTAL_KEY is set, a private key is generated and returned in the response.     CHEF_AUTOMATE_ADMIN_PASSWORD: The password for the administrative user in the Chef Automate web-based dashboard. The password length is a minimum of eight characters, and a maximum of 32. The password can contain letters, numbers, and special characters (!/@#$%^&+=_). The password must contain at least one lower case letter, one upper case letter, one number, and one special character. When no CHEF_AUTOMATE_ADMIN_PASSWORD is set, one is generated and returned in the response.    Attributes accepted in a Puppet createServer request:     PUPPET_ADMIN_PASSWORD: To work with the Puppet Enterprise console, a password must use ASCII characters.    PUPPET_R10K_REMOTE: The r10k remote is the URL of your control repository  (for example, ssh://git@your.git-repo.com:user/control-repo.git). Specifying an r10k remote opens TCP port 8170.    PUPPET_R10K_PRIVATE_KEY: If you are using a private Git repository, add  PUPPET_R10K_PRIVATE_KEY to specify a PEM-encoded private SSH key.
    ///   - engineModel:  The engine model of the server. Valid values in this release include Monolithic for Puppet and Single for Chef.
    ///   - engineVersion:  The major release version of the engine that you want to use. For a Chef server, the valid value for EngineVersion  is currently 2. For a Puppet server, valid values are 2019 or 2017.
    ///   - instanceProfileArn:  The ARN of the instance profile that your Amazon EC2 instances use. The OpsWorks console typically creates the instance profile for you
    ///   - instanceType:  The Amazon EC2 instance type to use. For example, m5.large.
    ///   - keyPair:  The Amazon EC2 key pair to set for the instance. This parameter is optional; if desired, you may specify this parameter to connect to your instances by using SSH.
    ///   - preferredBackupWindow:  The start time for a one-hour period during which OpsWorks CM backs up application-level data on your server if automated backups are enabled. Valid values must be specified in one of the following formats:     HH:MM for daily backups    DDD:HH:MM for weekly backups    MM must be specified as 00. The specified time is in coordinated universal time (UTC). The default value is a random, daily start time.  Example: 08:00, which represents a daily start time of 08:00 UTC.  Example: Mon:08:00, which represents a start time of every Monday at 08:00 UTC. (8:00 a.m.)
    ///   - preferredMaintenanceWindow:  The start time for a one-hour period each week during which OpsWorks CM performs maintenance on the instance. Valid values must be specified in the following format: DDD:HH:MM. MM must be specified as 00. The specified time is in coordinated universal time (UTC). The default value is a random one-hour period on Tuesday, Wednesday, or Friday. See TimeWindowDefinition for more information.   Example: Mon:08:00, which represents a start time of every Monday at 08:00 UTC. (8:00 a.m.)
    ///   - securityGroupIds:  A list of security group IDs to attach to the Amazon EC2 instance. If you add this parameter, the specified security groups must be within the VPC that is specified by SubnetIds.   If you do not specify this parameter, OpsWorks CM creates one new security group that uses TCP ports 22 and 443, open to 0.0.0.0/0 (everyone).
    ///   - serverName:  The name of the server. The server name must be unique within your Amazon Web Services account, within each region. Server names must start with a letter; then letters, numbers, or hyphens (-) are allowed, up to a maximum of 40 characters.
    ///   - serviceRoleArn:  The service role that the OpsWorks CM service backend uses to work with your account.
    ///   - subnetIds:  The IDs of subnets in which to launch the server EC2 instance.   Amazon EC2-Classic customers: This field is required. All servers must run within a VPC. The VPC must have "Auto Assign Public IP" enabled.   EC2-VPC customers: This field is optional. If you do not specify subnet IDs, your EC2 instances are created in a default subnet that  is selected by Amazon EC2. If you specify subnet IDs, the VPC must have "Auto Assign Public IP" enabled.  For more information about supported Amazon EC2 platforms, see Supported Platforms.
    ///   - tags: A map that contains tag keys and tag values to attach to an OpsWorks for Chef Automate or OpsWorks for Puppet Enterprise server.   The key cannot be empty.   The key can be a maximum of 127 characters, and can contain only Unicode letters, numbers, or separators, or the following special characters: + - = . _ : / @    The value can be a maximum 255 characters, and contain only Unicode letters, numbers, or separators, or the following special characters: + - = . _ : / @    Leading and trailing spaces are trimmed from both the key and value.   A maximum of 50 user-applied tags is allowed for any OpsWorks CM server.
    ///   - logger: Logger use during operation
    @inlinable
    public func createServer(
        associatePublicIpAddress: Bool? = nil,
        backupId: String? = nil,
        backupRetentionCount: Int? = nil,
        customCertificate: String? = nil,
        customDomain: String? = nil,
        customPrivateKey: String? = nil,
        disableAutomatedBackup: Bool? = nil,
        engine: String,
        engineAttributes: [EngineAttribute]? = nil,
        engineModel: String? = nil,
        engineVersion: String? = nil,
        instanceProfileArn: String,
        instanceType: String,
        keyPair: String? = nil,
        preferredBackupWindow: String? = nil,
        preferredMaintenanceWindow: String? = nil,
        securityGroupIds: [String]? = nil,
        serverName: String,
        serviceRoleArn: String,
        subnetIds: [String]? = nil,
        tags: [Tag]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateServerResponse {
        let input = CreateServerRequest(
            associatePublicIpAddress: associatePublicIpAddress, 
            backupId: backupId, 
            backupRetentionCount: backupRetentionCount, 
            customCertificate: customCertificate, 
            customDomain: customDomain, 
            customPrivateKey: customPrivateKey, 
            disableAutomatedBackup: disableAutomatedBackup, 
            engine: engine, 
            engineAttributes: engineAttributes, 
            engineModel: engineModel, 
            engineVersion: engineVersion, 
            instanceProfileArn: instanceProfileArn, 
            instanceType: instanceType, 
            keyPair: keyPair, 
            preferredBackupWindow: preferredBackupWindow, 
            preferredMaintenanceWindow: preferredMaintenanceWindow, 
            securityGroupIds: securityGroupIds, 
            serverName: serverName, 
            serviceRoleArn: serviceRoleArn, 
            subnetIds: subnetIds, 
            tags: tags
        )
        return try await self.createServer(input, logger: logger)
    }

    ///  Deletes a backup. You can delete both manual and automated backups. This operation is asynchronous.   An InvalidStateException is thrown when a backup deletion is already in progress. A ResourceNotFoundException is thrown when the backup does not exist. A ValidationException is thrown when parameters of the request are not valid.
    @Sendable
    @inlinable
    public func deleteBackup(_ input: DeleteBackupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteBackupResponse {
        try await self.client.execute(
            operation: "DeleteBackup", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Deletes a backup. You can delete both manual and automated backups. This operation is asynchronous.   An InvalidStateException is thrown when a backup deletion is already in progress. A ResourceNotFoundException is thrown when the backup does not exist. A ValidationException is thrown when parameters of the request are not valid.
    ///
    /// Parameters:
    ///   - backupId: The ID of the backup to delete. Run the DescribeBackups command to get a list of backup IDs. Backup IDs are in the format ServerName-yyyyMMddHHmmssSSS.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteBackup(
        backupId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteBackupResponse {
        let input = DeleteBackupRequest(
            backupId: backupId
        )
        return try await self.deleteBackup(input, logger: logger)
    }

    ///  Deletes the server and the underlying CloudFormation stacks (including the server's EC2 instance). When you run this command, the server state is updated to DELETING. After the server is deleted, it is no longer returned by DescribeServer requests. If the CloudFormation stack cannot be deleted, the server cannot be deleted.   This operation is asynchronous.   An InvalidStateException is thrown when a server deletion is already in progress. A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is raised when parameters of the request are not valid.
    @Sendable
    @inlinable
    public func deleteServer(_ input: DeleteServerRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteServerResponse {
        try await self.client.execute(
            operation: "DeleteServer", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Deletes the server and the underlying CloudFormation stacks (including the server's EC2 instance). When you run this command, the server state is updated to DELETING. After the server is deleted, it is no longer returned by DescribeServer requests. If the CloudFormation stack cannot be deleted, the server cannot be deleted.   This operation is asynchronous.   An InvalidStateException is thrown when a server deletion is already in progress. A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is raised when parameters of the request are not valid.
    ///
    /// Parameters:
    ///   - serverName: The ID of the server to delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteServer(
        serverName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteServerResponse {
        let input = DeleteServerRequest(
            serverName: serverName
        )
        return try await self.deleteServer(input, logger: logger)
    }

    ///  Describes your OpsWorks CM account attributes.   This operation is synchronous.
    @Sendable
    @inlinable
    public func describeAccountAttributes(_ input: DescribeAccountAttributesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeAccountAttributesResponse {
        try await self.client.execute(
            operation: "DescribeAccountAttributes", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Describes your OpsWorks CM account attributes.   This operation is synchronous.
    ///
    /// Parameters:
    ///   - logger: Logger use during operation
    @inlinable
    public func describeAccountAttributes(
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeAccountAttributesResponse {
        let input = DescribeAccountAttributesRequest(
        )
        return try await self.describeAccountAttributes(input, logger: logger)
    }

    ///  Describes backups. The results are ordered by time, with newest backups first. If you do not specify a BackupId or ServerName, the command returns all backups.   This operation is synchronous.   A ResourceNotFoundException is thrown when the backup does not exist. A ValidationException is raised when parameters of the request are not valid.
    @Sendable
    @inlinable
    public func describeBackups(_ input: DescribeBackupsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeBackupsResponse {
        try await self.client.execute(
            operation: "DescribeBackups", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Describes backups. The results are ordered by time, with newest backups first. If you do not specify a BackupId or ServerName, the command returns all backups.   This operation is synchronous.   A ResourceNotFoundException is thrown when the backup does not exist. A ValidationException is raised when parameters of the request are not valid.
    ///
    /// Parameters:
    ///   - backupId: Describes a single backup.
    ///   - maxResults: This is not currently implemented for DescribeBackups requests.
    ///   - nextToken: This is not currently implemented for DescribeBackups requests.
    ///   - serverName: Returns backups for the server with the specified ServerName.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeBackups(
        backupId: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        serverName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeBackupsResponse {
        let input = DescribeBackupsRequest(
            backupId: backupId, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            serverName: serverName
        )
        return try await self.describeBackups(input, logger: logger)
    }

    ///  Describes events for a specified server. Results are ordered by time, with newest events first.   This operation is synchronous.   A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is raised when parameters of the request are not valid.
    @Sendable
    @inlinable
    public func describeEvents(_ input: DescribeEventsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeEventsResponse {
        try await self.client.execute(
            operation: "DescribeEvents", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Describes events for a specified server. Results are ordered by time, with newest events first.   This operation is synchronous.   A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is raised when parameters of the request are not valid.
    ///
    /// Parameters:
    ///   - maxResults: To receive a paginated response, use this parameter to specify the maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a NextToken value that you can assign to the NextToken request parameter to get the next set of results.
    ///   - nextToken: NextToken is a string that is returned in some command responses. It indicates that not all entries have been returned, and that you must run at least one more request to get remaining items. To get remaining results, call DescribeEvents again, and assign the token from the previous results as the value of the nextToken parameter. If there are no more results, the response object's nextToken parameter value is null. Setting a nextToken value that was not returned in your previous results causes an InvalidNextTokenException to occur.
    ///   - serverName: The name of the server for which you want to view events.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeEvents(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        serverName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeEventsResponse {
        let input = DescribeEventsRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            serverName: serverName
        )
        return try await self.describeEvents(input, logger: logger)
    }

    ///  Returns the current status of an existing association or disassociation request.   A ResourceNotFoundException is thrown when no recent association or disassociation request with the specified token is found, or when the server does not exist. A ValidationException is raised when parameters of the request are not valid.
    @Sendable
    @inlinable
    public func describeNodeAssociationStatus(_ input: DescribeNodeAssociationStatusRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeNodeAssociationStatusResponse {
        try await self.client.execute(
            operation: "DescribeNodeAssociationStatus", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Returns the current status of an existing association or disassociation request.   A ResourceNotFoundException is thrown when no recent association or disassociation request with the specified token is found, or when the server does not exist. A ValidationException is raised when parameters of the request are not valid.
    ///
    /// Parameters:
    ///   - nodeAssociationStatusToken: The token returned in either the AssociateNodeResponse or the DisassociateNodeResponse.
    ///   - serverName: The name of the server from which to disassociate the node.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeNodeAssociationStatus(
        nodeAssociationStatusToken: String,
        serverName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeNodeAssociationStatusResponse {
        let input = DescribeNodeAssociationStatusRequest(
            nodeAssociationStatusToken: nodeAssociationStatusToken, 
            serverName: serverName
        )
        return try await self.describeNodeAssociationStatus(input, logger: logger)
    }

    ///  Lists all configuration management servers that are identified with your account. Only the stored results from Amazon DynamoDB are returned. OpsWorks CM does not query other services.   This operation is synchronous.   A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is raised when parameters of the request are not valid.
    @Sendable
    @inlinable
    public func describeServers(_ input: DescribeServersRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeServersResponse {
        try await self.client.execute(
            operation: "DescribeServers", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Lists all configuration management servers that are identified with your account. Only the stored results from Amazon DynamoDB are returned. OpsWorks CM does not query other services.   This operation is synchronous.   A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is raised when parameters of the request are not valid.
    ///
    /// Parameters:
    ///   - maxResults: This is not currently implemented for DescribeServers requests.
    ///   - nextToken: This is not currently implemented for DescribeServers requests.
    ///   - serverName: Describes the server with the specified ServerName.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeServers(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        serverName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeServersResponse {
        let input = DescribeServersRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            serverName: serverName
        )
        return try await self.describeServers(input, logger: logger)
    }

    ///  Disassociates a node from an OpsWorks CM server, and removes the node from the server's managed nodes. After a node is disassociated, the node key pair is no longer valid for accessing the configuration manager's API. For more information about how to associate a node, see AssociateNode.  A node can can only be disassociated from a server that is in a HEALTHY state. Otherwise, an InvalidStateException is thrown. A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is raised when parameters of the request are not valid.
    @Sendable
    @inlinable
    public func disassociateNode(_ input: DisassociateNodeRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DisassociateNodeResponse {
        try await self.client.execute(
            operation: "DisassociateNode", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Disassociates a node from an OpsWorks CM server, and removes the node from the server's managed nodes. After a node is disassociated, the node key pair is no longer valid for accessing the configuration manager's API. For more information about how to associate a node, see AssociateNode.  A node can can only be disassociated from a server that is in a HEALTHY state. Otherwise, an InvalidStateException is thrown. A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is raised when parameters of the request are not valid.
    ///
    /// Parameters:
    ///   - engineAttributes: Engine attributes that are used for disassociating the node. No attributes are required for Puppet.   Attributes required in a DisassociateNode request for Chef     CHEF_ORGANIZATION: The Chef organization with which the node was associated. By default only one organization named default can exist.
    ///   - nodeName: The name of the client node.
    ///   - serverName: The name of the server from which to disassociate the node.
    ///   - logger: Logger use during operation
    @inlinable
    public func disassociateNode(
        engineAttributes: [EngineAttribute]? = nil,
        nodeName: String,
        serverName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DisassociateNodeResponse {
        let input = DisassociateNodeRequest(
            engineAttributes: engineAttributes, 
            nodeName: nodeName, 
            serverName: serverName
        )
        return try await self.disassociateNode(input, logger: logger)
    }

    ///  Exports a specified server engine attribute as a base64-encoded string. For example, you can export user data that you can  use in EC2 to associate nodes with a server.   This operation is synchronous.   A ValidationException is raised when parameters of the request are not valid. A ResourceNotFoundException is thrown when the server does not exist. An InvalidStateException is thrown when the server is in any of the following states: CREATING, TERMINATED, FAILED or DELETING.
    @Sendable
    @inlinable
    public func exportServerEngineAttribute(_ input: ExportServerEngineAttributeRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ExportServerEngineAttributeResponse {
        try await self.client.execute(
            operation: "ExportServerEngineAttribute", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Exports a specified server engine attribute as a base64-encoded string. For example, you can export user data that you can  use in EC2 to associate nodes with a server.   This operation is synchronous.   A ValidationException is raised when parameters of the request are not valid. A ResourceNotFoundException is thrown when the server does not exist. An InvalidStateException is thrown when the server is in any of the following states: CREATING, TERMINATED, FAILED or DELETING.
    ///
    /// Parameters:
    ///   - exportAttributeName: The name of the export attribute. Currently, the supported export attribute is Userdata.  This exports a user data script that includes parameters and values provided in the InputAttributes list.
    ///   - inputAttributes: The list of engine attributes. The list type is EngineAttribute. An EngineAttribute list item  is a pair that includes an attribute name and its value. For the Userdata ExportAttributeName, the following are  supported engine attribute names.    RunList In Chef, a list of roles or recipes that are run in the specified order.  In Puppet, this parameter is ignored.    OrganizationName In Chef, an organization name. OpsWorks for Chef Automate  always creates the organization default. In Puppet, this parameter is ignored.    NodeEnvironment In Chef, a node environment (for example, development, staging, or one-box).  In Puppet, this parameter is ignored.    NodeClientVersion In Chef, the version of the Chef engine (three numbers separated  by dots, such as 13.8.5). If this attribute is empty, OpsWorks for Chef Automate uses the most current version. In Puppet,  this parameter is ignored.
    ///   - serverName: The name of the server from which you are exporting the attribute.
    ///   - logger: Logger use during operation
    @inlinable
    public func exportServerEngineAttribute(
        exportAttributeName: String,
        inputAttributes: [EngineAttribute]? = nil,
        serverName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ExportServerEngineAttributeResponse {
        let input = ExportServerEngineAttributeRequest(
            exportAttributeName: exportAttributeName, 
            inputAttributes: inputAttributes, 
            serverName: serverName
        )
        return try await self.exportServerEngineAttribute(input, logger: logger)
    }

    /// Returns a list of tags that are applied to the specified OpsWorks for Chef Automate or OpsWorks for Puppet Enterprise servers or backups.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a list of tags that are applied to the specified OpsWorks for Chef Automate or OpsWorks for Puppet Enterprise servers or backups.
    ///
    /// Parameters:
    ///   - maxResults: To receive a paginated response, use this parameter to specify the maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a NextToken value that you can assign to the NextToken request parameter to get the next set of results.
    ///   - nextToken: NextToken is a string that is returned in some command responses. It indicates that not all entries have been returned, and that you must run at least one more request to get remaining items. To get remaining results, call ListTagsForResource again, and assign the token from the previous results as the value of the nextToken parameter. If there are no more results, the response object's nextToken parameter value is null. Setting a nextToken value that was not returned in your previous results causes an InvalidNextTokenException to occur.
    ///   - resourceArn: The Amazon Resource Number (ARN) of an OpsWorks for Chef Automate or OpsWorks for Puppet Enterprise server for which you want to show applied tags. For example,  arn:aws:opsworks-cm:us-west-2:123456789012:server/test-owcm-server/EXAMPLE-66b0-4196-8274-d1a2bEXAMPLE.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    ///  Restores a backup to a server that is in a CONNECTION_LOST, HEALTHY, RUNNING, UNHEALTHY, or TERMINATED state. When you run RestoreServer, the server's EC2 instance is deleted, and a new EC2 instance is configured. RestoreServer maintains the existing server endpoint, so configuration management of the server's client devices (nodes) should continue to work.  Restoring from a backup is performed by creating a new EC2 instance. If restoration is successful, and the server is in a HEALTHY state,  OpsWorks CM switches traffic over to the new instance. After restoration is finished, the old EC2 instance is maintained in a  Running or Stopped state, but is eventually terminated.  This operation is asynchronous.   An InvalidStateException is thrown when the server is not in a valid state. A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is raised when parameters of the request are not valid.
    @Sendable
    @inlinable
    public func restoreServer(_ input: RestoreServerRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> RestoreServerResponse {
        try await self.client.execute(
            operation: "RestoreServer", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Restores a backup to a server that is in a CONNECTION_LOST, HEALTHY, RUNNING, UNHEALTHY, or TERMINATED state. When you run RestoreServer, the server's EC2 instance is deleted, and a new EC2 instance is configured. RestoreServer maintains the existing server endpoint, so configuration management of the server's client devices (nodes) should continue to work.  Restoring from a backup is performed by creating a new EC2 instance. If restoration is successful, and the server is in a HEALTHY state,  OpsWorks CM switches traffic over to the new instance. After restoration is finished, the old EC2 instance is maintained in a  Running or Stopped state, but is eventually terminated.  This operation is asynchronous.   An InvalidStateException is thrown when the server is not in a valid state. A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is raised when parameters of the request are not valid.
    ///
    /// Parameters:
    ///   - backupId:  The ID of the backup that you want to use to restore a server.
    ///   - instanceType:  The type of instance to restore. Valid values must be specified in the following format: ^([cm][34]|t2).* For example, m5.large. Valid values are m5.large, r5.xlarge, and r5.2xlarge. If you do not specify this parameter, RestoreServer uses the instance type from the specified backup.
    ///   - keyPair:  The name of the key pair to set on the new EC2 instance. This can be helpful if the administrator no longer has the SSH key.
    ///   - serverName:  The name of the server that you want to restore.
    ///   - logger: Logger use during operation
    @inlinable
    public func restoreServer(
        backupId: String,
        instanceType: String? = nil,
        keyPair: String? = nil,
        serverName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> RestoreServerResponse {
        let input = RestoreServerRequest(
            backupId: backupId, 
            instanceType: instanceType, 
            keyPair: keyPair, 
            serverName: serverName
        )
        return try await self.restoreServer(input, logger: logger)
    }

    ///  Manually starts server maintenance. This command can be useful if an earlier maintenance attempt failed, and the underlying cause of maintenance failure has been resolved. The server is in an UNDER_MAINTENANCE state while maintenance is in progress.   Maintenance can only be started on servers in HEALTHY and UNHEALTHY states. Otherwise, an InvalidStateException is thrown. A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is raised when parameters of the request are not valid.
    @Sendable
    @inlinable
    public func startMaintenance(_ input: StartMaintenanceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartMaintenanceResponse {
        try await self.client.execute(
            operation: "StartMaintenance", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Manually starts server maintenance. This command can be useful if an earlier maintenance attempt failed, and the underlying cause of maintenance failure has been resolved. The server is in an UNDER_MAINTENANCE state while maintenance is in progress.   Maintenance can only be started on servers in HEALTHY and UNHEALTHY states. Otherwise, an InvalidStateException is thrown. A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is raised when parameters of the request are not valid.
    ///
    /// Parameters:
    ///   - engineAttributes: Engine attributes that are specific to the server on which you want to run maintenance.  Attributes accepted in a StartMaintenance request for Chef     CHEF_MAJOR_UPGRADE: If a Chef Automate server is eligible for upgrade to Chef Automate 2,  add this engine attribute to a StartMaintenance request and set the value to true to upgrade the server to Chef Automate 2. For more information, see  Upgrade an OpsWorks for Chef Automate Server to Chef Automate 2.
    ///   - serverName: The name of the server on which to run maintenance.
    ///   - logger: Logger use during operation
    @inlinable
    public func startMaintenance(
        engineAttributes: [EngineAttribute]? = nil,
        serverName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartMaintenanceResponse {
        let input = StartMaintenanceRequest(
            engineAttributes: engineAttributes, 
            serverName: serverName
        )
        return try await self.startMaintenance(input, logger: logger)
    }

    /// Applies tags to an OpsWorks for Chef Automate or OpsWorks for Puppet Enterprise server, or to server backups.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Applies tags to an OpsWorks for Chef Automate or OpsWorks for Puppet Enterprise server, or to server backups.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Number (ARN) of a resource to which you want to apply tags. For example,  arn:aws:opsworks-cm:us-west-2:123456789012:server/test-owcm-server/EXAMPLE-66b0-4196-8274-d1a2bEXAMPLE.
    ///   - tags: A map that contains tag keys and tag values to attach to OpsWorks CM servers or backups.   The key cannot be empty.   The key can be a maximum of 127 characters, and can contain only Unicode letters, numbers, or separators, or the following special characters: + - = . _ : /    The value can be a maximum 255 characters, and contain only Unicode letters, numbers, or separators, or the following special characters: + - = . _ : /    Leading and trailing white spaces are trimmed from both the key and value.   A maximum of 50 user-applied tags is allowed for any OpsWorks CM server or backup.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [Tag],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes specified tags from an OpsWorks CM server or backup.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes specified tags from an OpsWorks CM server or backup.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Number (ARN) of a resource from which you want to remove tags. For example,  arn:aws:opsworks-cm:us-west-2:123456789012:server/test-owcm-server/EXAMPLE-66b0-4196-8274-d1a2bEXAMPLE.
    ///   - tagKeys: The keys of tags that you want to remove.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    ///  Updates settings for a server.   This operation is synchronous.
    @Sendable
    @inlinable
    public func updateServer(_ input: UpdateServerRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateServerResponse {
        try await self.client.execute(
            operation: "UpdateServer", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Updates settings for a server.   This operation is synchronous.
    ///
    /// Parameters:
    ///   - backupRetentionCount: Sets the number of automated backups that you want to keep.
    ///   - disableAutomatedBackup: Setting DisableAutomatedBackup to true disables automated or scheduled backups.  Automated backups are enabled by default.
    ///   - preferredBackupWindow: 
    ///   - preferredMaintenanceWindow: 
    ///   - serverName: The name of the server to update.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateServer(
        backupRetentionCount: Int? = nil,
        disableAutomatedBackup: Bool? = nil,
        preferredBackupWindow: String? = nil,
        preferredMaintenanceWindow: String? = nil,
        serverName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateServerResponse {
        let input = UpdateServerRequest(
            backupRetentionCount: backupRetentionCount, 
            disableAutomatedBackup: disableAutomatedBackup, 
            preferredBackupWindow: preferredBackupWindow, 
            preferredMaintenanceWindow: preferredMaintenanceWindow, 
            serverName: serverName
        )
        return try await self.updateServer(input, logger: logger)
    }

    ///  Updates engine-specific attributes on a specified server. The server enters the MODIFYING state when this operation is in progress. Only one update can occur at a time. You can use this command to reset a Chef server's public key (CHEF_PIVOTAL_KEY) or a Puppet server's  admin password (PUPPET_ADMIN_PASSWORD).   This operation is asynchronous.   This operation can only be called for servers in HEALTHY or UNHEALTHY states.  Otherwise, an InvalidStateException is raised. A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is  raised when parameters of the request are not valid.
    @Sendable
    @inlinable
    public func updateServerEngineAttributes(_ input: UpdateServerEngineAttributesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateServerEngineAttributesResponse {
        try await self.client.execute(
            operation: "UpdateServerEngineAttributes", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Updates engine-specific attributes on a specified server. The server enters the MODIFYING state when this operation is in progress. Only one update can occur at a time. You can use this command to reset a Chef server's public key (CHEF_PIVOTAL_KEY) or a Puppet server's  admin password (PUPPET_ADMIN_PASSWORD).   This operation is asynchronous.   This operation can only be called for servers in HEALTHY or UNHEALTHY states.  Otherwise, an InvalidStateException is raised. A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is  raised when parameters of the request are not valid.
    ///
    /// Parameters:
    ///   - attributeName: The name of the engine attribute to update.
    ///   - attributeValue: The value to set for the attribute.
    ///   - serverName: The name of the server to update.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateServerEngineAttributes(
        attributeName: String,
        attributeValue: String? = nil,
        serverName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateServerEngineAttributesResponse {
        let input = UpdateServerEngineAttributesRequest(
            attributeName: attributeName, 
            attributeValue: attributeValue, 
            serverName: serverName
        )
        return try await self.updateServerEngineAttributes(input, logger: logger)
    }
}

extension OpsWorksCM {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: OpsWorksCM, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension OpsWorksCM {
    /// Return PaginatorSequence for operation ``describeBackups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func describeBackupsPaginator(
        _ input: DescribeBackupsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<DescribeBackupsRequest, DescribeBackupsResponse> {
        return .init(
            input: input,
            command: self.describeBackups,
            inputKey: \DescribeBackupsRequest.nextToken,
            outputKey: \DescribeBackupsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``describeBackups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - backupId: Describes a single backup.
    ///   - maxResults: This is not currently implemented for DescribeBackups requests.
    ///   - serverName: Returns backups for the server with the specified ServerName.
    ///   - logger: Logger used for logging
    @inlinable
    public func describeBackupsPaginator(
        backupId: String? = nil,
        maxResults: Int? = nil,
        serverName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<DescribeBackupsRequest, DescribeBackupsResponse> {
        let input = DescribeBackupsRequest(
            backupId: backupId, 
            maxResults: maxResults, 
            serverName: serverName
        )
        return self.describeBackupsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``describeEvents(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func describeEventsPaginator(
        _ input: DescribeEventsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<DescribeEventsRequest, DescribeEventsResponse> {
        return .init(
            input: input,
            command: self.describeEvents,
            inputKey: \DescribeEventsRequest.nextToken,
            outputKey: \DescribeEventsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``describeEvents(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: To receive a paginated response, use this parameter to specify the maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a NextToken value that you can assign to the NextToken request parameter to get the next set of results.
    ///   - serverName: The name of the server for which you want to view events.
    ///   - logger: Logger used for logging
    @inlinable
    public func describeEventsPaginator(
        maxResults: Int? = nil,
        serverName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<DescribeEventsRequest, DescribeEventsResponse> {
        let input = DescribeEventsRequest(
            maxResults: maxResults, 
            serverName: serverName
        )
        return self.describeEventsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``describeServers(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func describeServersPaginator(
        _ input: DescribeServersRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<DescribeServersRequest, DescribeServersResponse> {
        return .init(
            input: input,
            command: self.describeServers,
            inputKey: \DescribeServersRequest.nextToken,
            outputKey: \DescribeServersResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``describeServers(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: This is not currently implemented for DescribeServers requests.
    ///   - serverName: Describes the server with the specified ServerName.
    ///   - logger: Logger used for logging
    @inlinable
    public func describeServersPaginator(
        maxResults: Int? = nil,
        serverName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<DescribeServersRequest, DescribeServersResponse> {
        let input = DescribeServersRequest(
            maxResults: maxResults, 
            serverName: serverName
        )
        return self.describeServersPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listTagsForResource(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listTagsForResourcePaginator(
        _ input: ListTagsForResourceRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListTagsForResourceRequest, ListTagsForResourceResponse> {
        return .init(
            input: input,
            command: self.listTagsForResource,
            inputKey: \ListTagsForResourceRequest.nextToken,
            outputKey: \ListTagsForResourceResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listTagsForResource(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: To receive a paginated response, use this parameter to specify the maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a NextToken value that you can assign to the NextToken request parameter to get the next set of results.
    ///   - resourceArn: The Amazon Resource Number (ARN) of an OpsWorks for Chef Automate or OpsWorks for Puppet Enterprise server for which you want to show applied tags. For example,  arn:aws:opsworks-cm:us-west-2:123456789012:server/test-owcm-server/EXAMPLE-66b0-4196-8274-d1a2bEXAMPLE.
    ///   - logger: Logger used for logging
    @inlinable
    public func listTagsForResourcePaginator(
        maxResults: Int? = nil,
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListTagsForResourceRequest, ListTagsForResourceResponse> {
        let input = ListTagsForResourceRequest(
            maxResults: maxResults, 
            resourceArn: resourceArn
        )
        return self.listTagsForResourcePaginator(input, logger: logger)
    }
}

extension OpsWorksCM.DescribeBackupsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> OpsWorksCM.DescribeBackupsRequest {
        return .init(
            backupId: self.backupId,
            maxResults: self.maxResults,
            nextToken: token,
            serverName: self.serverName
        )
    }
}

extension OpsWorksCM.DescribeEventsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> OpsWorksCM.DescribeEventsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            serverName: self.serverName
        )
    }
}

extension OpsWorksCM.DescribeServersRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> OpsWorksCM.DescribeServersRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            serverName: self.serverName
        )
    }
}

extension OpsWorksCM.ListTagsForResourceRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> OpsWorksCM.ListTagsForResourceRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            resourceArn: self.resourceArn
        )
    }
}

// MARK: Waiters

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension OpsWorksCM {
    /// Waiter for operation ``describeNodeAssociationStatus(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilNodeAssociated(
        _ input: DescribeNodeAssociationStatusRequest,
        maxWaitTime: TimeAmount? = nil,
        logger: Logger = AWSClient.loggingDisabled
    ) async throws {
        let waiter = AWSClient.Waiter<DescribeNodeAssociationStatusRequest, _>(
            acceptors: [
                .init(state: .success, matcher: try! JMESPathMatcher("nodeAssociationStatus", expected: "SUCCESS")),
                .init(state: .failure, matcher: try! JMESPathMatcher("nodeAssociationStatus", expected: "FAILED")),
            ],
            minDelayTime: .seconds(15),
            command: self.describeNodeAssociationStatus
        )
        return try await self.client.waitUntil(input, waiter: waiter, maxWaitTime: maxWaitTime, logger: logger)
    }
    /// Waiter for operation ``describeNodeAssociationStatus(_:logger:)``.
    ///
    /// - Parameters:
    ///   - nodeAssociationStatusToken: The token returned in either the AssociateNodeResponse or the DisassociateNodeResponse.
    ///   - serverName: The name of the server from which to disassociate the node.
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilNodeAssociated(
        nodeAssociationStatusToken: String,
        serverName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DescribeNodeAssociationStatusRequest(
            nodeAssociationStatusToken: nodeAssociationStatusToken, 
            serverName: serverName
        )
        try await self.waitUntilNodeAssociated(input, logger: logger)
    }
}
